From 0e65f04e1e780865f80660df315e800e6b0cbccd Mon Sep 17 00:00:00 2001
From: Ilion Beyst <ilion.beyst@gmail.com>
Date: Tue, 1 Nov 2022 22:36:19 +0100
Subject: move bot versions to its own tab

---
 web/pw-server/src/routes/bots/[bot_name]/__layout.svelte | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'web/pw-server/src/routes/bots/[bot_name]/__layout.svelte')

diff --git a/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte b/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
index baa8f99..f445cbb 100644
--- a/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
+++ b/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
@@ -16,6 +16,8 @@
 </script>
 
 <script lang="ts">
+  import { currentUser } from "$lib/stores/current_user";
+
   export let bot;
   export let owner;
 </script>
@@ -36,6 +38,9 @@
     <a class="bot-tab" href={`/bots/${bot.name}`}>index</a>
     <a class="bot-tab" href={`/bots/${bot.name}/matches`}>matches</a>
     <a class="bot-tab" href={`/bots/${bot.name}/stats`}>stats</a>
+    {#if $currentUser && $currentUser["user_id"] === bot["owner_id"]}
+      <a class="bot-tab" href={`/bots/${bot.name}/versions`}>versions</a>
+    {/if}
   </div>
 </div>
 <slot />
-- 
cgit v1.2.3

